package itheima.com.Utiley;

import org.junit.Test;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class FileReader_ {

    public static void main(String[] args) {


    }

    @Test
    public void FileReaderlist(){

        FileReader fr = null;
        String fsPath = "D:\\一条小团团\\demo.txt";
        int data = 0;
        char[] buf = new char[8];
        try {
            fr = new FileReader(fsPath);
            while ((data = fr.read(buf)) !=-1){
                System.out.print(new String(buf,0,data));
//                System.out.print((char)data);
            }

        } catch (IOException e) {
            throw new RuntimeException(e);
        }finally {
            try {
                fr.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

    }

}
